#!/bin/bash

. /etc/profile

echo "kawins 2018-9-18"

set -e

PRO_NAME="spring-gradle"

rm -rf ${PRO_NAME}
rm -rf $(cd `dirname $0`; pwd)/common
rm -rf $(cd `dirname $0`; pwd)/kubernetes
rm -rf $(cd `dirname $0`; pwd)/script.gradle

echo " ====开始拉取仓库最新脚本==== "

git clone http://gitlab.xayy.tech/gaolin/spring-gradle.git

cd ${PRO_NAME}

git checkout dev

cd ..

mv ${PRO_NAME}/gradle-boot/script/common independent/script
mv ${PRO_NAME}/gradle-boot/script/kubernetes independent/script
mv ${PRO_NAME}/gradle-boot/script/script.gradle independent/script
if [ ! -f "independent/script/Dockerfile" ];then
  mv ${PRO_NAME}/gradle-boot/script/Dockerfile independent/script
else
  echo "有自己的Dockerfile"
fi
rm -rf ${PRO_NAME}